import { Component, OnDestroy } from 'angular2/core';
import { TreeViewComponent } from './treeview.component';
import { TreeData } from './tree-data';
import { SnippetsData } from './snippetsdata';
import { TreeViewService } from './treeview.service';

@Component({
  selector: 'my-app',
  templateUrl: '/app/app.component.html',
  styleUrls: ['app/app.component.css'],
  directives: [TreeViewComponent],
  providers: [TreeViewService]
})
export class AppComponent implements OnDestroy{
  treeServiceSubscription: any;
  treeSelectedInfo: string;
  constructor(private _treeService: TreeViewService) {
    SnippetsData.init(this._treeService);
  }

  ngOnDestroy() {
    this.treeServiceSubscription.dispose();
  }
}


/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/